<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="keys" content="">
    <meta name="author" content="">
    <base th:href="@{/}" />
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/login.css">
    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="jquery/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="layer/layer.js"></script>
    <script type="text/javascript" src="myscript/regist-remind.js"></script>
    <script type="text/javascript">
        $(function (){
            $("#getCodeBtn").click(function (){
                var phoneNum = $.trim($("[name=phoneNum]").val());

                $.ajax({
                    url:"auth/member/send/short/message.json",
                    type:"POST",
                    data:{
                        "phoneNum":phoneNum
                    },
                    dataType:"json",
                    success:function (response){
                        var result = response.result;
                        if (result == "SUCCESS"){
                            layer.msg("发送成功");
                            return
                        }
                        layer.msg("发送失败");
                    },
                    error:function (response){
                        layer.msg(response.status+" "+response.statusText);
                    }
                })
            })

            $("#registBtn").click(function (){

                var account = $.trim($("[name=loginacct]").val());
                var username = $.trim($("[name=username]").val());
                var password = $.trim($("[name=userpswd]").val());
                var passwordAgain = $.trim($("[name=userpswdAgain]").val());
                var email = $.trim($("[name=email]").val());
                var phoneNum = $.trim($("[name=phoneNum]").val());
                var code = $.trim($("[name=code]").val());
                if (account == ""|| username == "" || password == "" || passwordAgain == "" || email == "" || phoneNum == "" || code == ""){
                    $("#message").html("<font size=\"4\">请输入完整信息</font>");
                    return false;
                }
            })
            })

    </script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <div><a class="navbar-brand" href="index.html" style="font-size:32px;">尚筹网-创意产品众筹平台</a></div>
        </div>
    </div>
</nav>

<div class="container">

    <form action="/auth/member/do/regist" type="post" class="form-signin" role="form">
        <h2 class="form-signin-heading"><i class="glyphicon glyphicon-log-in"></i> 用户注册
            <span style="color: red" th:id="message" > <font size="4">[[${message}]]</font></span>
        </h2>

        <span style="color: red" th:id="errorAccountMessage"> </span>
        <div class="form-group has-success has-feedback">
            <input th:name="loginacct" th:onblur="accountRemind()"  type="text"  class="form-control" id="inputSuccess4" placeholder="请输入登录账号" autofocus>
            <span class="glyphicon glyphicon-user form-control-feedback"></span>
        </div>

        <span style="color: red" th:id="errorUsernameMessage"> </span>
        <div class="form-group has-success has-feedback">
            <input th:name="username" th:onblur="usernameRemind()"  type="text"  class="form-control" id="inputSuccess4" placeholder="请输入用户昵称" autofocus>
            <span class="glyphicon glyphicon-user form-control-feedback"></span>
        </div>

        <span style="color: red" th:id="errorPasswordMessage"> </span>
        <div class="form-group has-success has-feedback">
            <input th:name="userpswd" th:onblur="passwordRemind()"  type="text"  class="form-control" id="inputSuccess4" placeholder="请输入登录密码" style="margin-top:10px;">
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
        </div>

        <span style="color: red" th:id="errorPasswordAgainMessage"> </span>
        <div class="form-group has-success has-feedback">
            <input th:name="userpswdAgain" th:onblur="passwordAgainRemind()" type="text"  class="form-control" id="inputSuccess4" placeholder="请再次输入登录密码" style="margin-top:10px;">
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
        </div>

        <span style="color: red" th:id="errorEmailMessage"> </span>
        <div class="form-group has-success has-feedback">
            <input th:name="email" th:onblur="emailRemind()" type="text"  class="form-control" id="inputSuccess4" placeholder="请输入邮箱地址" style="margin-top:10px;">
            <span class="glyphicon glyphicon glyphicon-envelope form-control-feedback"></span>
        </div>

        <span style="color: red" th:id="phoneNumErrorMessage"> </span>
        <div class="form-group has-success has-feedback">
            <input th:name="phoneNum" th:onblur="phoneNumRemind()"  type="text"  class="form-control" id="inputSuccess4" placeholder="请输入手机号" style="margin-top:10px;">
            <span class="glyphicon glyphicon glyphicon-earphone form-control-feedback"></span>
        </div>

        <div class="form-group has-success has-feedback">
            <input th:name="code" type="text" class="form-control" id="inputSuccess4" placeholder="请输入验证码" style="margin-top:10px;">
            <span class="glyphicon glyphicon glyphicon-comment form-control-feedback"></span>
        </div>
        <button type="button" th:id="getCodeBtn" class="btn btn-lg btn-success btn-block"> 获取验证码</button>
        <button type="submit" th:id="registBtn" class="btn btn-lg btn-success btn-block" >注册</button>
    </form>
</div>

</body>
</html>